<template>
	<view class="goods" @click="goGoodsDetail(item.id)">
		<image :src="item.img_url" mode=""></image>
		<view class="text-content">
			<view class="price">
				<text class="cprice">￥{{item.sell_price}}</text>
				<text class="oprice">￥{{item.market_price}}</text>
			</view>
			<text class="name">{{item.title}}</text>

		</view>
	</view>
</template>

<script>
	export default {
		props: {
			item: {
				type: Object,
				default: () => {}
			}
		},
		methods: {
			goGoodsDetail(id) {
				uni.navigateTo({
					url: '/pages/GoodsDetail/GoodsDetail?id=' + id
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.goods {
		width: 360rpx;
		height: 560rpx;
		background-color: #ffffff;
		box-sizing: border-box;
		border-bottom: 14rpx solid #eeeeee;

		image {
			width: 286rpx;
			height: 300rpx;
		}

		.text-content {
			margin-left: 14rpx;

			.name {
				margin-top: 20rpx 0rpx;
				display: inline-block;
				line-height: 50rpx;
			}

			.price {
				padding-bottom: 10rpx;

				.cprice {
					color: #c41d01;
					font-size: 38rpx;
				}

				.oprice {
					color: #cccccc;
					font-size: 30rpx;
					text-decoration: line-through;
				}
			}
		}

	}
</style>